package com.drakulo.games.ais.core.building;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.drakulo.games.ais.core.Resource;

/**
 * Represents all characteristics of a building at a given level : production,
 * consumption, upgrade cost and store space.
 * 
 * @author Drakulo
 * 
 */
public class BuildingLevelData {
	/** The production map : how much the building will produce */
	private Map<Resource, BigDecimal> production;
	/** The consumption map : how much the building will consume */
	private Map<Resource, BigDecimal> consumption;
	/** The upgrade cost map : how much resources for upgrading to next level */
	private Map<Resource, BigDecimal> upgradeCost;
	/** The amount of resources storable by the building */
	private Map<Resource, BigDecimal> storeCapacity;
	/** Technologies needed to upgrade the building to next level */
	private List<String> technologiesNeeded;
	/** The building's special actions */
	private List<String> specialActions;

	/**
	 * Constructor
	 */
	public BuildingLevelData() {
		this.production = new HashMap<Resource, BigDecimal>();
		this.consumption = new HashMap<Resource, BigDecimal>();
		this.upgradeCost = new HashMap<Resource, BigDecimal>();
		this.storeCapacity = new HashMap<Resource, BigDecimal>();
	}

	/**
	 * Add a production resource
	 * 
	 * @param resource
	 *            the resource
	 * @param amount
	 *            the amount producted
	 */
	public void addProduction(Resource resource, BigDecimal amount) {
		this.production.put(resource, amount);
	}

	/**
	 * Add a consumption resource
	 * 
	 * @param resource
	 *            the resource
	 * @param amount
	 *            the amount consumed
	 */
	public void addConsumption(Resource resource, BigDecimal amount) {
		this.consumption.put(resource, amount);
	}

	/**
	 * Add an upgrade resource
	 * 
	 * @param resource
	 *            the resource
	 * @param amount
	 *            the amount of resources needed to upgrade
	 */
	public void addUpgradeCost(Resource resource, BigDecimal amount) {
		this.upgradeCost.put(resource, amount);
	}

	/**
	 * Add a storable resource
	 * 
	 * @param resource
	 *            the resource storable
	 * @param amount
	 *            the amount of resources storable
	 */
	public void addStoreCapacity(Resource resource, BigDecimal amount) {
		this.storeCapacity.put(resource, amount);
	}

	public Map<Resource, BigDecimal> getProduction() {
		return this.production;
	}

	public Map<Resource, BigDecimal> getConsumption() {
		return this.consumption;
	}

	public Map<Resource, BigDecimal> getUpgradeCost() {
		return this.upgradeCost;
	}

	public Map<Resource, BigDecimal> getStoreCapacity() {
		return this.storeCapacity;
	}

	public void setProduction(Map<Resource, BigDecimal> production) {
		this.production = production;
	}

	public void setConsumption(Map<Resource, BigDecimal> consumption) {
		this.consumption = consumption;
	}

	public void setUpgradeCost(Map<Resource, BigDecimal> upgradeCost) {
		this.upgradeCost = upgradeCost;
	}

	public void setStoreCapacity(Map<Resource, BigDecimal> storeCapacity) {
		this.storeCapacity = storeCapacity;
	}

	public List<String> getTechnologiesNeeded() {
		return this.technologiesNeeded;
	}

	public void setTechnologiesNeeded(List<String> technologiesNeeded) {
		this.technologiesNeeded = technologiesNeeded;
	}

	public List<String> getSpecialActions() {
		return specialActions;
	}

	public void setSpecialActions(List<String> specialActions) {
		this.specialActions = specialActions;
	}

}
